<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>玉米商城</title>
<link rel="stylesheet" type="text/css" href="#{$smarty.const.APP}#/View/template/home/css/hui.css" />
<style type="text/css">
/* 自定义样式  */
.hui-hot-sreach {
	background: #FFFFFF;
	padding: 12px;
}
.hui-hot-sreach-title {
	line-height: 38px;
	font-size: 15px;
	font-weight: 700;
}
.hui-hot-sreach-keys {
	margin-top: 8px;
}
.hui-hot-sreach-keys a {
	display: block;
	border-radius: 5px;
	float: left;
	margin: 0 8px 10px 0px;
	padding: 6px 10px;
	line-height: 20px;
	font-size: 13px;
	background: #EFF3F6;
}
</style>
</head>
<body>
<header class="hui-header">
  <div id="hui-back"></div>
  <h1>#{$shop_name}#</h1>
  <a class="hui-header-sreach-txt" href="#{$smarty.const.ACT}#/home/WxMemberAddress/member_address_add/'"></a>
</header>
<div class="hui-center-title" style="margin-top:30px;"></div>
<style>
    #list2 li{width:50%; float:left; 0px;}
    #list2 .hui-img-list-content{padding:5px; padding-bottom:10px;}
    #list2 h1{font-size:14px;}
</style>
<div class="hui-img-list" id="list2" style="padding:10px 5px;">
  <ul>
    #{foreach from=$list key=k item=v}#
    <li> <a href="#{$smarty.const.ACT}#/home/WxProduct/product_show_one/id/#{$v.id}#/">
      <div class="hui-media-list-img" style="max-height: 150px;"><img src="#{$v.img1}#" /></div>
      <div class="hui-img-list-content">
        <h1>#{$v.name}#</h1>
        <p>#{$v.price}#</p>
      </div>
      </a> </li>
    #{/foreach}#
  </ul>
</div>
<script src="#{$smarty.const.APP}#/View/template/home/js/hui.js" type="text/javascript" charset="utf-8"></script> 
<script type="text/javascript" charset="utf-8" >
//监听搜索事件
document.getElementById('searchKey').addEventListener('keyup', function(e){if(e.keyCode == 13){searchNow();}});
function hotSearch(k){
	hui('#searchKey').val(k);
	searchNow();
}
//核心搜索函数
function searchNow(){
	document.activeElement.blur();
	var kwd = hui('#searchKey').val();
	kwd = kwd.trim();
	if(kwd.length < 2){
		hui.toast('关键字至少2个字符');
		hui('.hui-hot-sreach').show();
		return;
	}
	//关闭热搜
	hui('.hui-hot-sreach').hide();
	hui.toast('搜索 '+ kwd);
	var url='#{$smarty.const.ACT}#/home/WxProduct/product_show/name/'+encodeURIComponent(kwd)+"/";
	hui.toast(encodeURIComponent(kwd));
	hui.open(url);
	
}
//清空
function clearSearch(){
	hui('#searchKey').val('');
	hui('.hui-hot-sreach').show();
}
/* slide menu */
hui.slideMenu();
</script>
</body>
</html>